#ifndef IMAGE_LOADER_H_
#define IMAGE_LOADER_H_

#include "../Scene/ZDataManager.h"
#include "ZMLAlgorithm.h"

GLOBAL_NAMESPACE_BEGIN
NAMESPACE_MACHINE_LEARNING_BEGIN

class ImageLoaderImpl;
class ImageFragment;

class ImageLoader
{
public:
    ImageLoader(DataManager* manager);
    ~ImageLoader();

    void init();
    int extractFragments(int num, const std::string& outFolder);
    int extractFeaturesForImage(ImageSpace::Image* ima, std::vector<double>& feature, bool saveFeaImg = false);

    int getFragmentCount() const;
    const ImageFragment* getFragment(int idx) const;

    void addFragment(const ImageFragment& frag);
    void finalize();

private:
    std::auto_ptr<ImageLoaderImpl> impl_;
};

NAMESPACE_MACHINE_LEARNING_END
GLOBAL_NAMESPACE_END

#endif//IMAGE_LOADER_H_